﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using Yule8xCommon.Applib;

namespace Yule8xWechat.Other
{
    public partial class NickNames : System.Web.UI.Page
    {
        protected int count;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                tb_content.Text = RuntimeDataUtil.GetNickNameText();
                count = tb_content.Text.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries).Length;
            }

        }

        protected void btn_save_Click(object sender, EventArgs e)
        {
            try
            {
                File.WriteAllText(RuntimeDataUtil.filePathes.nicknames_file, tb_content.Text);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
                Response.End();
            }
            Response.Redirect("NickNames.aspx?result=success");
        }
    }
}